Generally, a comparator is applied to a voltage difference input between a positive phase input and a negative phase input. When a voltage of the positive phase input is higher than the voltage of the negative phase input, a high voltage level signal is output at an output. When the voltage of the positive phase input is lower than the voltage of the negative phase input, a low voltage level signal is output at the output.
The sensitivity of the comparator is high, and the anti-interference of the comparator is poor. If an input voltage or a ground terminal contains some noise, output error will be generated. Therefore, a hysteresis function is usually added to a comparator circuit, and signal hysteresis can be used to avoid oscillation of the comparator output caused by the input noise.
FIG. 1 is a circuit diagram of a conventional hysteresis comparator. As shown in FIG. 1, in a comparator circuit 10 with hysteresis function, two N-channel metal-oxide-semiconductor (NMOS) transistors 11 and 12 form a differential pair, and connect to a first input voltage (VP) and a second input voltage (VM), respectively. When noise exists, the voltage value of the first input voltage (VP) and the second input voltage (VM) will be slightly different. The difference results in errors in the output of the comparator without hysteresis. Therefore, two P-channel metal-oxide-semiconductor (PMOS) transistors 14 and 15 are added to the comparator circuit 10 with hysteresis function, which avoids the output change of the comparator 10 due to noise in the input signal. The threshold value is set by the two PMOS transistors 14 and 15, so that the output signal of the comparator 10 with hysteresis function outputs a high level or low level signal when the output of the comparator 10 with hysteresis function is higher than the upper threshold or lower than the lower threshold, the high level or low level signal will be output. The output signal of the comparator with hysteresis function does not change between the upper and lower thresholds, and is called the hysteresis window. However, the upper and lower thresholds of the threshold values of the two PMOS transistors 14 and 15 are easily changed by the semiconductor manufacturing process or temperature, and variations in the threshold value result in a change in the hysteresis window.
Therefore, reducing the change of the hysteresis window in the comparator with hysteresis function with the influence of semiconductor production process or temperature through the improvement of circuit design has become one of the important issues to be solved.